package com.lam.framework.operLog.enums;

import com.lam.framework.operLog.model.Operator;

/**
 * 操作人类别
 * 
 * @author lam
 */
public enum OperatorType implements Operator {
	
	/** 后台 */
	ADMIN("a", "后台用户"),

	/** app */
	FRONT("api", "前端app"),
	
	/** 其它 */
	OTHER("o", "其他"),
	
	/** 自动识别 */
	AUTO("auto", "自动识别"),
	;
	
	private String type;
	private String typeName;
	
	private OperatorType(String type, String typeName) {
		this.type = type;
		this.typeName = typeName;
	}
	
	public static OperatorType valueFrom(String type) {
		for (OperatorType o : values()) {
			if(o.type.equalsIgnoreCase(type)) {
				return o;
			}
		}
		return OTHER;
	}
	
	public String getType() {
		return type;
	}
	public String getTypeName() {
		return typeName;
	}
	
}
